# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.UrlShortener.V1.Model.AnalyticsSnapshot do
  @moduledoc """


  ## Attributes

  *   `browsers` (*type:* `list(GoogleApi.UrlShortener.V1.Model.StringCount.t)`, *default:* `nil`) - Top browsers, e.g. "Chrome"; sorted by (descending) click counts. Only present if this data is available.
  *   `countries` (*type:* `list(GoogleApi.UrlShortener.V1.Model.StringCount.t)`, *default:* `nil`) - Top countries (expressed as country codes), e.g. "US" or "DE"; sorted by (descending) click counts. Only present if this data is available.
  *   `longUrlClicks` (*type:* `String.t`, *default:* `nil`) - Number of clicks on all goo.gl short URLs pointing to this long URL.
  *   `platforms` (*type:* `list(GoogleApi.UrlShortener.V1.Model.StringCount.t)`, *default:* `nil`) - Top platforms or OSes, e.g. "Windows"; sorted by (descending) click counts. Only present if this data is available.
  *   `referrers` (*type:* `list(GoogleApi.UrlShortener.V1.Model.StringCount.t)`, *default:* `nil`) - Top referring hosts, e.g. "www.google.com"; sorted by (descending) click counts. Only present if this data is available.
  *   `shortUrlClicks` (*type:* `String.t`, *default:* `nil`) - Number of clicks on this short URL.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :browsers => list(GoogleApi.UrlShortener.V1.Model.StringCount.t()),
          :countries => list(GoogleApi.UrlShortener.V1.Model.StringCount.t()),
          :longUrlClicks => String.t(),
          :platforms => list(GoogleApi.UrlShortener.V1.Model.StringCount.t()),
          :referrers => list(GoogleApi.UrlShortener.V1.Model.StringCount.t()),
          :shortUrlClicks => String.t()
        }

  field(:browsers, as: GoogleApi.UrlShortener.V1.Model.StringCount, type: :list)
  field(:countries, as: GoogleApi.UrlShortener.V1.Model.StringCount, type: :list)
  field(:longUrlClicks)
  field(:platforms, as: GoogleApi.UrlShortener.V1.Model.StringCount, type: :list)
  field(:referrers, as: GoogleApi.UrlShortener.V1.Model.StringCount, type: :list)
  field(:shortUrlClicks)
end

defimpl Poison.Decoder, for: GoogleApi.UrlShortener.V1.Model.AnalyticsSnapshot do
  def decode(value, options) do
    GoogleApi.UrlShortener.V1.Model.AnalyticsSnapshot.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.UrlShortener.V1.Model.AnalyticsSnapshot do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
